home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1995.rar / 1995 / MAY / Ge9505 / cust4.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-11  |  979b  |  49 lines

  1. unit Cust4;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages,
  7.   Classes, Graphics, Controls, Forms, Dialogs;
  8.  
  9. type
  10.   CustComp4 = class(TComponent)
  11.   private
  12.     { Private declarations }
  13.     FDemoProp: Integer;
  14.     function  GetDemoProp: Integer;
  15.     procedure SetDemoProp(Val: Integer);
  16.   protected
  17.     { Protected declarations }
  18.   public
  19.     { Public declarations }
  20.   published
  21.     { Published declarations }
  22.     property DemoProp: Integer read  GetDemoProp
  23.                                write SetDemoProp;
  24.   end;
  25.  
  26. procedure Register;
  27.  
  28. implementation
  29.  
  30. function CustComp4.GetDemoProp;
  31. begin
  32.   {Return the value of the FDemoProp field}
  33.   {In a more complex example, add other code here}
  34.   Result := FDemoProp;
  35. end;
  36.  
  37. procedure CustComp4.SetDemoProp(Val: Integer);
  38. begin
  39.   { Set a new value for the FDemoProp field }
  40.   FDemoProp:= Val;
  41. end;
  42.  
  43. procedure Register;
  44. begin
  45.   RegisterComponents('Custom', [CustComp4]);
  46. end;
  47.  
  48. end.
  49.